﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZhiAo.CommonLibrary
{
    public class UserInfo2
    {
        //这边为什么UserId 采用 string  目的是使其根据具有通用性   可以对应到业务系统的不同类型

        public static string UserId
        {
            get
            {
                if (PageHelper.Session["__UserId"] == null)
                {
                    UserId = "";
                }
                return PageHelper.Session["__UserId"].ToString();
            }
            set { PageHelper.Session["__UserId"] = value; }
        }
        public static string UserName
        {
            get
            {
                if (PageHelper.Session["__UserName"] == null)
                {
                    UserName = "";
                }
                return PageHelper.Session["__UserName"].ToString();
            }
            set { PageHelper.Session["__UserName"] = value; }
        }

        public static string LoginNo
        {
            get
            {
                if (PageHelper.Session["__LoginNo"] == null)
                {
                    LoginNo = "";
                }
                return PageHelper.Session["__LoginNo"].ToString();
            }
            set { PageHelper.Session["__LoginNo"] = value; }
        }

        public static string LoginTime
        {
            get
            {
                if (PageHelper.Session["__LoginTime"] == null)
                {
                    LoginTime = "";
                }
                return PageHelper.Session["__LoginTime"].ToString();
            }
            set { PageHelper.Session["__LoginTime"] = value; }
        }

        public static string RoleId
        {
            get
            {
                if (PageHelper.Session["__RoleId"] == null)
                {
                    RoleId = "";
                }
                return PageHelper.Session["__RoleId"].ToString();
            }
            set { PageHelper.Session["__RoleId"] = value; }
        }
        public static string RoleName
        {
            get
            {
                if (PageHelper.Session["__RoleName"] == null)
                {
                    RoleName = "";
                }
                return PageHelper.Session["__RoleName"].ToString();
            }
            set { PageHelper.Session["__RoleName"] = value; }
        }

        public static string RoleType
        {
            get
            {
                if (PageHelper.Session["__RoleType"] == null)
                {
                    RoleType = "";
                }
                return PageHelper.Session["__RoleType"].ToString();
            }
            set { PageHelper.Session["__RoleType"] = value; }
        }

        public static string OperSide
        {
            get
            {
                if (PageHelper.Session["__OperSide"] == null)
                {
                    OperSide = "";
                }
                return PageHelper.Session["__OperSide"].ToString();
            }
            set { PageHelper.Session["__OperSide"] = value; }
        }

        public static string OperSideName
        {
            get
            {
                if (PageHelper.Session["__OperSideName"] == null)
                {
                    OperSideName = "";
                }
                return PageHelper.Session["__OperSideName"].ToString();
            }
            set { PageHelper.Session["__OperSideName"] = value; }
        }

        public static string CompanyCode
        {
            get
            {
                if (PageHelper.Session["__CompanyCode"] == null)
                {
                    CompanyCode = "";
                }
                return PageHelper.Session["__CompanyCode"].ToString();
            }
            set { PageHelper.Session["__CompanyCode"] = value; }
        }

        public static string CompanyName
        {
            get
            {
                if (PageHelper.Session["__CompanyName"] == null)
                {
                    CompanyName = "";
                }
                return PageHelper.Session["__CompanyName"].ToString();
            }
            set { PageHelper.Session["__CompanyName"] = value; }
        }

        public static bool UseOKTip
        {
            get
            {
                if (PageHelper.Session["__UseOKTip"] == null)
                {
                    UseOKTip = false;
                }
                return PageHelper.Session["__UseOKTip"].ToString() == "Y";
            }
            set { PageHelper.Session["__UseOKTip"] = value ? "Y" : "N"; }
        }


        public static string Language
        {
            get
            {
                if (PageHelper.Session["__Language"] == null)
                {
                    Language = "";
                }
                return PageHelper.Session["__Language"].ToString();
            }
            set { PageHelper.Session["__Language"] = value; }
        }

        public static void Clear()
        {
            UserId = "";
            UserName = "";
            LoginNo = "";
            RoleId = "";
            RoleName = "";
            OperSide = "";
            OperSideName = "";
            CompanyCode = "";
            CompanyName = "";
        }
    }
}
